import request from '@/common/utils/request'


/**
 * 获取-部门列表
 * @returns
 */
export const getLeaderListApi = () => {
    return request({
        url: '/company/department',
        method: 'GET',
    })
}

/**
 * 获取-部门负责人列表
 * @returns
 */
export const getLeaderHeadListApi = () => {
    return request({
        url: '/sys/user/simple',
        method: 'GET',
    })
}


/**
 * 获取-部门详情
 * @returns
 */
export const getDepartmentDetailsApi = (id: number) => {
    return request({
        url: `/company/department/${id}`,
        method: 'GET',
    })
}

/**
 * 新增-部门详情
 * @returns
 */
export const postAdddepartmentApi = (data) => {
    return request({
        url: '/company/department',
        method: 'POST',
        data
    })
}

/**
 * 修改-部门详情
 * @returns
 */
export const putAdddepartmentApi = (data) => {
    return request({
        url: `/company/department/${data.id}`,
        method: 'PUT',
        data
    })
}

/**
 * 删除-部门
 * @returns
 */
export const deleteAdddepartmentApi = (id: number) => {
    return request({
        url: `/company/department/${id}`,
        method: 'DELETE'
    })
}